#include "GameCC.h"

List::List()
{
   Count = 0;
}

void List::add(void* Item)
{
	if (Count >= MAX_LIST_COUNT) return;
	Items[Count++] = Item;
}

void* List::item(int Index)
{
	if (Index >= Count) return NULL;
	else return Items[Index];
}

void* List::getRandomItem(void)
{
	if (Count <= 0) return NULL;
	else return item(GetRandomNumber(Count));
}


StrList::StrList()
{
   Count = 0;
}

void StrList::add(char* Item)
{
	if (Count >= MAX_LIST_COUNT) return;
	strcpy(Items[Count++], Item);
}

char* StrList::item(int Index)
{
	if (Index >= Count) return NULL;
	else return Items[Index];
}

char* StrList::getRandomItem(void)
{
	if (Count <= 0) return NULL;
	else return item(GetRandomNumber(Count));
}
